﻿CREATE TRIGGER [TRG_Data_Insert]
ON [dbo].[Data]
FOR INSERT
AS
BEGIN
	SET NOCOUNT ON

	ALTER TABLE [dbo].[Data] DISABLE TRIGGER TRG_Data_Update

	UPDATE	D
	SET		D.[DataFullPath] = PARENT.DataFullName
	FROM	[dbo].[Data] D
	INNER JOIN [dbo].[Data] PARENT ON D.ParentDataId = PARENT.DataId
	WHERE D.DataId = (SELECT DataId FROM inserted)

	ALTER TABLE [dbo].[Data] ENABLE TRIGGER TRG_Data_Update

END
